{% extends "bootstrap/base.html" %}

{% block head %}
    {{ super() }}
    <style type="text/css">
        textarea[name=body] {
            height: 200px;
        }
    </style>
    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
    <link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css') }}">
{% endblock %}

{% block scripts %}
{{ super() }}
{{ moment.include_moment() }}
{% endblock %}

{% block title %}Flask{% endblock %}

{% block navbar %}
<nav class="navbar navbar-inverse">
    <div class="container">
        <div class="navbar-header">
            <a class="navbar-brand" href="/">Flask</a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="nav-item active">
                    <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">Link</a>
                </li>
                {% if current_user.is_authenticated %}
                    <li class="nav-item">
                        <a href="{{ url_for('main.user', username=current_user.username) }}">
                            Profile
                        </a>
                    </li>
                {% endif %}
                {% if current_user.can(Permission.MODERATE_COMMENT) %}
                    <li><a href="{{ url_for('main.moderate') }}">Moderate Comments</a></li>
                {% endif %}
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {% if current_user.is_authenticated %}
                <li><a href="{{ url_for('auth.logout') }}">Sign Out</a></li>
                {% else %}
                <li><a href="{{ url_for('auth.login') }}">Sign In</a></li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>
{% endblock %}

{% block content %}
<div class="container">
    {% for message in get_flashed_messages() %}
    <div class="alert alert-warning">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        {{ message }}
    </div>
    {% endfor %}
    {% block page_content %}{% endblock %}
</div>
{% endblock %}